package me.yricky.cov_spectrum.ui.content

import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import me.yricky.cov_spectrum.model.beans.CountryData

@Composable
fun CountryList(
    modifier: Modifier = Modifier,
    list: List<CountryData>,
    onClick:(CountryData)->Unit = {},
){
    LazyColumn(modifier = modifier){
        items(list, key = {it.covSpectrumName}){
            Column(Modifier.padding(4.dp).clickable { onClick(it) }) {
                Text(text = it.covSpectrumName, style = MaterialTheme.typography.h5)
                Text(text = it.gisaidName)
                Text(text = it.region)
            }
        }
    }
}